home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / SASC_6.0_Disk_4.adf / Compiler_Headers / Include / intuition / intuition.h < prev    next >
C/C++ Source or Header  |  1992-07-30  |  53KB  |  1,365 lines

  1. #ifndef INTUITION_INTUITION_H
  2. #define INTUITION_INTUITION_H TRUE
  3. /*
  4. **  $Filename: intuition/intuition.h $
  5. **  $Release: 2.04 Includes, V37.4 $
  6. **  $Revision: 36.51 $
  7. **  $Date: 91/03/28 $
  8. **
  9. **  Interface definitions for Intuition applications.
  10. **
  11. **  (C) Copyright 1985-1991 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. */
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include <exec/types.h>
  17. #endif
  18.  
  19. #ifndef GRAPHICS_GFX_H
  20. #include <graphics/gfx.h>
  21. #endif
  22.  
  23. #ifndef GRAPHICS_CLIP_H
  24. #include <graphics/clip.h>
  25. #endif
  26.  
  27. #ifndef GRAPHICS_VIEW_H
  28. #include <graphics/view.h>
  29. #endif
  30.  
  31. #ifndef GRAPHICS_RASTPORT_H
  32. #include <graphics/rastport.h>
  33. #endif
  34.  
  35. #ifndef GRAPHICS_LAYERS_H
  36. #include <graphics/layers.h>
  37. #endif
  38.  
  39. #ifndef GRAPHICS_TEXT_H
  40. #include <graphics/text.h>
  41. #endif
  42.  
  43. #ifndef EXEC_PORTS_H
  44. #include <exec/ports.h>
  45. #endif
  46.  
  47. #ifndef DEVICES_INPUTEVENT_H
  48. #include <devices/inputevent.h>
  49. #endif
  50.  
  51. #ifndef UTILITY_TAGITEM_H
  52. #include <utility/tagitem.h>
  53. #endif
  54.  
  55. /*
  56.  * NOTE:  intuition/iobsolete.h is included at the END of this file!
  57.  */
  58.  
  59. /* ======================================================================== */
  60. /* === Menu =============================================================== */
  61. /* ======================================================================== */
  62. struct Menu
  63. {
  64.     struct Menu *NextMenu;    /* same level */
  65.     WORD LeftEdge, TopEdge;    /* position of the select box */
  66.     WORD Width, Height;    /* dimensions of the select box */
  67.     UWORD Flags;        /* see flag definitions below */
  68.     BYTE *MenuName;        /* text for this Menu Header */
  69.     struct MenuItem *FirstItem; /* pointer to first in chain */
  70.  
  71.     /* these mysteriously-named variables are for internal use only */
  72.     WORD JazzX, JazzY, BeatX, BeatY;
  73. };
  74.  
  75.  
  76. /* FLAGS SET BY BOTH THE APPLIPROG AND INTUITION */
  77. #define MENUENABLED 0x0001    /* whether or not this menu is enabled */
  78.  
  79. /* FLAGS SET BY INTUITION */
  80. #define MIDRAWN 0x0100        /* this menu's items are currently drawn */
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87. /* ======================================================================== */
  88. /* === MenuItem =========================================================== */
  89. /* ======================================================================== */
  90. struct MenuItem
  91. {
  92.     struct MenuItem *NextItem;    /* pointer to next in chained list */
  93.     WORD LeftEdge, TopEdge;    /* position of the select box */
  94.     WORD Width, Height;        /* dimensions of the select box */
  95.     UWORD Flags;        /* see the defines below */
  96.  
  97.     LONG MutualExclude;        /* set bits mean this item excludes that */
  98.  
  99.     APTR ItemFill;        /* points to Image, IntuiText, or NULL */
  100.  
  101.     /* when this item is pointed to by the cursor and the items highlight
  102.      *    mode HIGHIMAGE is selected, this alternate image will be displayed
  103.      */
  104.     APTR SelectFill;        /* points to Image, IntuiText, or NULL */
  105.  
  106.     BYTE Command;        /* only if appliprog sets the COMMSEQ flag */
  107.  
  108.     struct MenuItem *SubItem;    /* if non-zero, points to MenuItem for submenu */
  109.  
  110.     /* The NextSelect field represents the menu number of next selected
  111.      *    item (when user has drag-selected several items)
  112.      */
  113.     UWORD NextSelect;
  114. };
  115.  
  116.  
  117. /* FLAGS SET BY THE APPLIPROG */
  118. #define CHECKIT        0x0001    /* set to indicate checkmarkable item */
  119. #define ITEMTEXT    0x0002    /* set if textual, clear if graphical item */
  120. #define COMMSEQ        0x0004    /* set if there's an command sequence */
  121. #define MENUTOGGLE    0x0008    /* set for toggling checks (else mut. exclude) */
  122. #define ITEMENABLED    0x0010    /* set if this item is enabled */
  123.  
  124. /* these are the SPECIAL HIGHLIGHT FLAG state meanings */
  125. #define HIGHFLAGS    0x00C0    /* see definitions below for these bits */
  126. #define HIGHIMAGE    0x0000    /* use the user's "select image" */
  127. #define HIGHCOMP    0x0040    /* highlight by complementing the selectbox */
  128. #define HIGHBOX        0x0080    /* highlight by "boxing" the selectbox */
  129. #define HIGHNONE    0x00C0    /* don't highlight */
  130.  
  131. /* FLAGS SET BY BOTH APPLIPROG AND INTUITION */
  132. #define CHECKED    0x0100    /* state of the checkmark */
  133.  
  134. /* FLAGS SET BY INTUITION */
  135. #define ISDRAWN        0x1000    /* this item's subs are currently drawn */
  136. #define HIGHITEM    0x2000    /* this item is currently highlighted */
  137. #define MENUTOGGLED    0x4000    /* this item was already toggled */
  138.  
  139.  
  140.  
  141.  
  142.  
  143. /* ======================================================================== */
  144. /* === Requester ========================================================== */
  145. /* ======================================================================== */
  146. struct Requester
  147. {
  148.     struct Requester *OlderRequest;
  149.     WORD LeftEdge, TopEdge;        /* dimensions of the entire box */
  150.     WORD Width, Height;            /* dimensions of the entire box */
  151.     WORD RelLeft, RelTop;        /* for Pointer relativity offsets */
  152.  
  153.     struct Gadget *ReqGadget;        /* pointer to a list of Gadgets */
  154.     struct Border *ReqBorder;        /* the box's border */
  155.     struct IntuiText *ReqText;        /* the box's text */
  156.     UWORD Flags;            /* see definitions below */
  157.  
  158.     /* pen number for back-plane fill before draws */
  159.     UBYTE BackFill;
  160.     /* Layer in place of clip rect    */
  161.     struct Layer *ReqLayer;
  162.  
  163.     UBYTE ReqPad1[32];
  164.  
  165.     /* If the BitMap plane pointers are non-zero, this tells the system
  166.      * that the image comes pre-drawn (if the appliprog wants to define
  167.      * its own box, in any shape or size it wants!);  this is OK by
  168.      * Intuition as long as there's a good correspondence between
  169.      * the image and the specified Gadgets
  170.      */
  171.     struct BitMap *ImageBMap;    /* points to the BitMap of PREDRAWN imagery */
  172.     struct Window *RWindow;    /* added.  points back to Window */
  173.  
  174.     struct Image  *ReqImage;    /* new for V36: drawn if USEREQIMAGE set */
  175.  
  176.     UBYTE ReqPad2[32];
  177. };
  178.  
  179.  
  180. /* FLAGS SET BY THE APPLIPROG */
  181. #define POINTREL    0x0001
  182.               /* if POINTREL set, TopLeft is relative to pointer
  183.                * for DMRequester, relative to window center
  184.                * for Request().
  185.                */
  186. #define PREDRAWN    0x0002
  187.     /* set if Requester.ImageBMap points to predrawn Requester imagery */
  188. #define NOISYREQ    0x0004
  189.     /* if you don't want requester to filter input       */
  190. #define SIMPLEREQ    0x0010
  191.     /* to use SIMPLEREFRESH layer (recommended)    */
  192.  
  193. /* New for V36        */
  194. #define USEREQIMAGE    0x0020
  195.     /*  render linked list ReqImage after BackFill
  196.      * but before gadgets and text
  197.      */
  198. #define NOREQBACKFILL    0x0040
  199.     /* don't bother filling requester with Requester.BackFill pen    */
  200.  
  201.  
  202. /* FLAGS SET BY INTUITION */
  203. #define REQOFFWINDOW    0x1000    /* part of one of the Gadgets was offwindow */
  204. #define REQACTIVE    0x2000    /* this requester is active */
  205. #define SYSREQUEST    0x4000    /* (unused) this requester caused by system */
  206. #define DEFERREFRESH    0x8000    /* this Requester stops a Refresh broadcast */
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213. /* ======================================================================== */
  214. /* === Gadget ============================================================= */
  215. /* ======================================================================== */
  216. struct Gadget
  217. {
  218.     struct Gadget *NextGadget;    /* next gadget in the list */
  219.  
  220.     WORD LeftEdge, TopEdge;    /* "hit box" of gadget */
  221.     WORD Width, Height;        /* "hit box" of gadget */
  222.  
  223.     UWORD Flags;        /* see below for list of defines */
  224.  
  225.     UWORD Activation;        /* see below for list of defines */
  226.  
  227.     UWORD GadgetType;        /* see below for defines */
  228.  
  229.     /* appliprog can specify that the Gadget be rendered as either as Border
  230.      * or an Image.  This variable points to which (or equals NULL if there's
  231.      * nothing to be rendered about this Gadget)
  232.      */
  233.     APTR GadgetRender;
  234.  
  235.     /* appliprog can specify "highlighted" imagery rather than algorithmic
  236.      * this can point to either Border or Image data
  237.      */
  238.     APTR SelectRender;
  239.  
  240.     struct IntuiText *GadgetText;   /* text for this gadget */
  241.  
  242.     /* MutualExclude, never implemented, is now declared obsolete.
  243.      * There are published examples of implementing a more general
  244.      * and practical exclusion in your applications.
  245.      *
  246.      * Starting with V36, this field is used to point to a hook
  247.      * for a custom gadget.
  248.      *
  249.      * Programs using this field for their own processing will
  250.      * continue to work, as long as they don't try the
  251.      * trick with custom gadgets.
  252.      */
  253.     LONG MutualExclude;  /* obsolete */
  254.  
  255.     /* pointer to a structure of special data required by Proportional,
  256.      * String and Integer Gadgets
  257.      */
  258.     APTR SpecialInfo;
  259.  
  260.     UWORD GadgetID;    /* user-definable ID field */
  261.     APTR UserData;    /* ptr to general purpose User data (ignored by In) */
  262. };
  263.  
  264.  
  265. /* --- Gadget.Flags values    --- */
  266. /* combinations in these bits describe the highlight technique to be used */
  267. #define GFLG_GADGHIGHBITS 0x0003
  268. #define GFLG_GADGHCOMP      0x0000  /* Complement the select box */
  269. #define GFLG_GADGHBOX      0x0001  /* Draw a box around the image */
  270. #define GFLG_GADGHIMAGE      0x0002  /* Blast in this alternate image */
  271. #define GFLG_GADGHNONE      0x0003  /* don't highlight */
  272.  
  273. #define GFLG_GADGIMAGE          0x0004  /* set if GadgetRender and SelectRender
  274.                    * point to an Image structure, clear
  275.                    * if they point to Border structures
  276.                    */
  277.  
  278. /* combinations in these next two bits specify to which corner the gadget's
  279.  *  Left & Top coordinates are relative.  If relative to Top/Left,
  280.  *  these are "normal" coordinates (everything is relative to something in
  281.  *  this universe).
  282.  *
  283.  * Gadget positions and dimensions are relative to the window or
  284.  * requester which contains the gadget
  285.  */
  286. #define GFLG_RELBOTTOM      0x0008  /* vert. pos. is relative to bottom edge */
  287. #define GFLG_RELRIGHT      0x0010  /* horiz. pos. is relative to right edge */
  288. #define GFLG_RELWIDTH      0x0020  /* width is relative to req/window    */
  289. #define GFLG_RELHEIGHT      0x0040  /* height is relative to req/window    */
  290.  
  291. #define GFLG_SELECTED      0x0080  /* you may initialize and look at this    */
  292.  
  293. /* the GFLG_DISABLED flag is initialized by you and later set by Intuition
  294.  * according to your calls to On/OffGadget().  It specifies whether or not
  295.  * this Gadget is currently disabled from being selected
  296.  */
  297. #define GFLG_DISABLED      0x0100
  298.  
  299. /* These flags specify the type of text field that Gadget.GadgetText
  300.  * points to.  In all normal (pre-V36) gadgets which you initialize
  301.  * this field should always be zero.  Some types of gadget objects
  302.  * created from classes will use these fields to keep track of
  303.  * types of labels/contents that different from IntuiText, but are
  304.  * stashed in GadgetText.
  305.  */
  306.  
  307. #define GFLG_LABELMASK      0x3000
  308. #define GFLG_LABELITEXT      0x0000  /* GadgetText points to IntuiText    */
  309. #define    GFLG_LABELSTRING  0x1000  /* GadgetText points to (UBYTE *)    */
  310. #define GFLG_LABELIMAGE      0x2000  /* GadgetText points to Image (object)    */
  311.  
  312. /* New for V37: GFLG_TABCYCLE */
  313. #define GFLG_TABCYCLE      0x0200  /* (string or custom) gadget participates in
  314.                    * cycling activation with Tab or Shift-Tab
  315.                    */
  316. /* New for V37: GFLG_STRINGEXTEND.  We discovered that V34 doesn't properly
  317.  * ignore the value we had chosen for the Gadget->Activation flag
  318.  * GACT_STRINGEXTEND.  NEVER SET THAT FLAG WHEN RUNNING UNDER V34.
  319.  * The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is
  320.  * safe under V34, and equivalent to GACT_STRINGEXTEND under V37.
  321.  * (Note that the two flags are not numerically equal)
  322.  */
  323. #define GFLG_STRINGEXTEND 0x0400  /* this String Gadget has StringExtend    */
  324.  
  325. /* ---    Gadget.Activation flag values    --- */
  326. /* Set GACT_RELVERIFY if you want to verify that the pointer was still over
  327.  * the gadget when the select button was released.  Will cause
  328.  * an IDCMP_GADGETUP message to be sent if so.
  329.  */
  330. #define GACT_RELVERIFY      0x0001
  331.  
  332. /* the flag GACT_IMMEDIATE, when set, informs the caller that the gadget
  333.  *  was activated when it was activated.  This flag works in conjunction with
  334.  *  the GACT_RELVERIFY flag
  335.  */
  336. #define GACT_IMMEDIATE      0x0002
  337.  
  338. /* the flag GACT_ENDGADGET, when set, tells the system that this gadget,
  339.  * when selected, causes the Requester to be ended.  Requesters
  340.  * that are ended are erased and unlinked from the system.
  341.  */
  342. #define GACT_ENDGADGET      0x0004
  343.  
  344. /* the GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive
  345.  * reports on mouse movements while this gadget is active.
  346.  * You probably want to set the GACT_IMMEDIATE flag when using
  347.  * GACT_FOLLOWMOUSE, since that's the only reasonable way you have of
  348.  * learning why Intuition is suddenly sending you a stream of mouse
  349.  * movement events.  If you don't set GACT_RELVERIFY, you'll get at
  350.  * least one Mouse Position event.
  351.  * Note: boolean FOLLOWMOUSE gadgets require GACT_RELVERIFY to get
  352.  * _any_ mouse movement events (this unusual behavior is a compatibility
  353.  * hold-over from the old days).
  354.  */
  355. #define GACT_FOLLOWMOUSE  0x0008
  356.  
  357. /* if any of the BORDER flags are set in a Gadget that's included in the
  358.  * Gadget list when a Window is opened, the corresponding Border will
  359.  * be adjusted to make room for the Gadget
  360.  */
  361. #define GACT_RIGHTBORDER  0x0010
  362. #define GACT_LEFTBORDER      0x0020
  363. #define GACT_TOPBORDER      0x0040
  364. #define GACT_BOTTOMBORDER 0x0080
  365. #define GACT_BORDERSNIFF  0x8000  /* neither set nor rely on this bit    */
  366.  
  367. #define GACT_TOGGLESELECT 0x0100  /* this bit for toggle-select mode */
  368. #define GACT_BOOLEXTEND      0x2000  /* this Boolean Gadget has a BoolInfo    */
  369.  
  370. /* should properly be in StringInfo, but aren't    */
  371. #define GACT_STRINGLEFT      0x0000  /* NOTE WELL: that this has value zero    */
  372. #define GACT_STRINGCENTER 0x0200
  373. #define GACT_STRINGRIGHT  0x0400
  374. #define GACT_LONGINT      0x0800  /* this String Gadget is for Long Ints    */
  375. #define GACT_ALTKEYMAP      0x1000  /* this String has an alternate keymap    */
  376. #define GACT_STRINGEXTEND 0x2000  /* this String Gadget has StringExtend    */
  377.                   /* NOTE: NEVER SET GACT_STRINGEXTEND IF YOU
  378.                    * ARE RUNNING ON LESS THAN V36!  SEE
  379.                    * GFLG_STRINGEXTEND (ABOVE) INSTEAD
  380.                    */
  381.  
  382. #define GACT_ACTIVEGADGET 0x4000  /* this gadget is "active".  This flag
  383.                    * is maintained by Intuition, and you
  384.                    * cannot count on its value persisting
  385.                    * while you do something on your program's
  386.                    * task.  It can only be trusted by
  387.                    * people implementing custom gadgets
  388.                    */
  389.  
  390. /* note 0x8000 is used above (GACT_BORDERSNIFF);
  391.  * all Activation flags defined */
  392.  
  393. /* --- GADGET TYPES ------------------------------------------------------- */
  394. /* These are the Gadget Type definitions for the variable GadgetType
  395.  * gadget number type MUST start from one.  NO TYPES OF ZERO ALLOWED.
  396.  * first comes the mask for Gadget flags reserved for Gadget typing
  397.  */
  398. #define GTYP_GADGETTYPE    0xFC00    /* all Gadget Global Type flags (padded) */
  399. #define GTYP_SYSGADGET    0x8000    /* 1 = Allocated by the system, 0 = by app. */
  400. #define GTYP_SCRGADGET    0x4000    /* 1 = ScreenGadget, 0 = WindowGadget */
  401. #define GTYP_GZZGADGET    0x2000    /* 1 = for WFLG_GIMMEZEROZERO borders */
  402. #define GTYP_REQGADGET    0x1000    /* 1 = this is a Requester Gadget */
  403. /* system gadgets */
  404. #define GTYP_SIZING    0x0010
  405. #define GTYP_WDRAGGING    0x0020
  406. #define GTYP_SDRAGGING    0x0030
  407. #define GTYP_WUPFRONT    0x0040
  408. #define GTYP_SUPFRONT    0x0050
  409. #define GTYP_WDOWNBACK    0x0060
  410. #define GTYP_SDOWNBACK    0x0070
  411. #define GTYP_CLOSE    0x0080
  412. /* application gadgets */
  413. #define GTYP_BOOLGADGET    0x0001
  414. #define GTYP_GADGET0002    0x0002
  415. #define GTYP_PROPGADGET    0x0003
  416. #define GTYP_STRGADGET    0x0004
  417. #define GTYP_CUSTOMGADGET    0x0005
  418. #define GTYP_GTYPEMASK    0x0007    /* masks out to gadget class    */
  419.  
  420. /* This bit in GadgetType is reserved for undocumented internal use
  421.  * by the Gadget Toolkit, and cannot be used nor relied on by
  422.  * applications:    0x0100
  423.  */
  424.  
  425. /* ======================================================================== */
  426. /* === BoolInfo======================================================= */
  427. /* ======================================================================== */
  428. /* This is the special data needed by an Extended Boolean Gadget
  429.  * Typically this structure will be pointed to by the Gadget field SpecialInfo
  430.  */
  431. struct BoolInfo
  432. {
  433.     UWORD  Flags;    /* defined below */
  434.     UWORD  *Mask;    /* bit mask for highlighting and selecting
  435.              * mask must follow the same rules as an Image
  436.              * plane.  Its width and height are determined
  437.              * by the width and height of the gadget's
  438.              * select box. (i.e. Gadget.Width and .Height).
  439.              */
  440.     ULONG  Reserved;    /* set to 0    */
  441. };
  442.  
  443. /* set BoolInfo.Flags to this flag bit.
  444.  * in the future, additional bits might mean more stuff hanging
  445.  * off of BoolInfo.Reserved.
  446.  */
  447. #define BOOLMASK    0x0001    /* extension is for masked gadget */
  448.  
  449. /* ======================================================================== */
  450. /* === PropInfo =========================================================== */
  451. /* ======================================================================== */
  452. /* this is the special data required by the proportional Gadget
  453.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  454.  */
  455. struct PropInfo
  456. {
  457.     UWORD Flags;    /* general purpose flag bits (see defines below) */
  458.  
  459.     /* You initialize the Pot variables before the Gadget is added to
  460.      * the system.  Then you can look here for the current settings
  461.      * any time, even while User is playing with this Gadget.  To
  462.      * adjust these after the Gadget is added to the System, use
  463.      * ModifyProp();  The Pots are the actual proportional settings,
  464.      * where a value of zero means zero and a value of MAXPOT means
  465.      * that the Gadget is set to its maximum setting.
  466.      */
  467.     UWORD HorizPot;    /* 16-bit FixedPoint horizontal quantity percentage */
  468.     UWORD VertPot;    /* 16-bit FixedPoint vertical quantity percentage */
  469.  
  470.     /* the 16-bit FixedPoint Body variables describe what percentage of
  471.      * the entire body of stuff referred to by this Gadget is actually
  472.      * shown at one time.  This is used with the AUTOKNOB routines,
  473.      * to adjust the size of the AUTOKNOB according to how much of
  474.      * the data can be seen.  This is also used to decide how far
  475.      * to advance the Pots when User hits the Container of the Gadget.
  476.      * For instance, if you were controlling the display of a 5-line
  477.      * Window of text with this Gadget, and there was a total of 15
  478.      * lines that could be displayed, you would set the VertBody value to
  479.      *       (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
  480.      * Therefore, the AUTOKNOB would fill 1/3 of the container, and
  481.      * if User hits the Cotainer outside of the knob, the pot would
  482.      * advance 1/3 (plus or minus) If there's no body to show, or
  483.      * the total amount of displayable info is less than the display area,
  484.      * set the Body variables to the MAX.  To adjust these after the
  485.      * Gadget is added to the System, use ModifyProp();
  486.      */
  487.     UWORD HorizBody;        /* horizontal Body */
  488.     UWORD VertBody;        /* vertical Body */
  489.  
  490.     /* these are the variables that Intuition sets and maintains */
  491.     UWORD CWidth;    /* Container width (with any relativity absoluted) */
  492.     UWORD CHeight;    /* Container height (with any relativity absoluted) */
  493.     UWORD HPotRes, VPotRes;    /* pot increments */
  494.     UWORD LeftBorder;        /* Container borders */
  495.     UWORD TopBorder;        /* Container borders */
  496. };
  497.  
  498.  
  499. /* --- FLAG BITS ---------------------------------------------------------- */
  500. #define AUTOKNOB    0x0001    /* this flag sez:  gimme that old auto-knob */
  501. /* NOTE: if you do not use an AUTOKNOB for a proportional gadget,
  502.  * you are currently limited to using a single Image of your own
  503.  * design: Intuition won't handle a linked list of images as
  504.  * a proportional gadget knob.
  505.  */
  506.  
  507. #define FREEHORIZ    0x0002    /* if set, the knob can move horizontally */
  508. #define FREEVERT    0x0004    /* if set, the knob can move vertically */
  509. #define PROPBORDERLESS    0x0008    /* if set, no border will be rendered */
  510. #define KNOBHIT        0x0100    /* set when this Knob is hit */
  511. #define PROPNEWLOOK    0x0010    /* set this if you want to get the new
  512.                  * V36 look
  513.                  */
  514.  
  515. #define KNOBHMIN    6    /* minimum horizontal size of the Knob */
  516. #define KNOBVMIN    4    /* minimum vertical size of the Knob */
  517. #define MAXBODY        0xFFFF    /* maximum body value */
  518. #define MAXPOT            0xFFFF    /* maximum pot value */
  519.  
  520.  
  521. /* ======================================================================== */
  522. /* === StringInfo ========================================================= */
  523. /* ======================================================================== */
  524. /* this is the special data required by the string Gadget
  525.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  526.  */
  527. struct StringInfo
  528. {
  529.     /* you initialize these variables, and then Intuition maintains them */
  530.     UBYTE *Buffer;    /* the buffer containing the start and final string */
  531.     UBYTE *UndoBuffer;    /* optional buffer for undoing current entry */
  532.     WORD BufferPos;    /* character position in Buffer */
  533.     WORD MaxChars;    /* max number of chars in Buffer (including NULL) */
  534.     WORD DispPos;    /* Buffer position of first displayed character */
  535.  
  536.     /* Intuition initializes and maintains these variables for you */
  537.     WORD UndoPos;    /* character position in the undo buffer */
  538.     WORD NumChars;    /* number of characters currently in Buffer */
  539.     WORD DispCount;    /* number of whole characters visible in Container */
  540.     WORD CLeft, CTop;    /* topleft offset of the container */
  541.  
  542.     /* This unused field is changed to allow extended specification
  543.      * of string gadget parameters.  It is ignored unless the flag
  544.      * GACT_STRINGEXTEND is set in the Gadget's Activation field
  545.      * or the GFLG_STRINGEXTEND flag is set in the Gadget Flags field.
  546.      * (See GFLG_STRINGEXTEND for an important note)
  547.      */
  548.     /* struct Layer *LayerPtr;    --- obsolete --- */
  549.     struct StringExtend *Extension;
  550.  
  551.     /* you can initialize this variable before the gadget is submitted to
  552.      * Intuition, and then examine it later to discover what integer
  553.      * the user has entered (if the user never plays with the gadget,
  554.      * the value will be unchanged from your initial setting)
  555.      */
  556.     LONG LongInt;
  557.  
  558.     /* If you want this Gadget to use your own Console keymapping, you
  559.      * set the GACT_ALTKEYMAP bit in the Activation flags of the Gadget,
  560.      * and then set this variable to point to your keymap.  If you don't
  561.      * set the GACT_ALTKEYMAP, you'll get the standard ASCII keymapping.
  562.      */
  563.     struct KeyMap *AltKeyMap;
  564. };
  565.  
  566. /* ======================================================================== */
  567. /* === IntuiText ========================================================== */
  568. /* ======================================================================== */
  569. /* IntuiText is a series of strings that start with a location
  570.  *  (always relative to the upper-left corner of something) and then the
  571.  *  text of the string.  The text is null-terminated.
  572.  */
  573. struct IntuiText
  574. {
  575.     UBYTE FrontPen, BackPen;    /* the pen numbers for the rendering */
  576.     UBYTE DrawMode;        /* the mode for rendering the text */
  577.     WORD LeftEdge;        /* relative start location for the text */
  578.     WORD TopEdge;        /* relative start location for the text */
  579.     struct TextAttr *ITextFont;    /* if NULL, you accept the default */
  580.     UBYTE *IText;        /* pointer to null-terminated text */
  581.     struct IntuiText *NextText; /* pointer to another IntuiText to render */
  582. };
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589. /* ======================================================================== */
  590. /* === Border ============================================================= */
  591. /* ======================================================================== */
  592. /* Data type Border, used for drawing a series of lines which is intended for
  593.  *  use as a border drawing, but which may, in fact, be used to render any
  594.  *  arbitrary vector shape.
  595.  *  The routine DrawBorder sets up the RastPort with the appropriate
  596.  *  variables, then does a Move to the first coordinate, then does Draws
  597.  *  to the subsequent coordinates.
  598.  *  After all the Draws are done, if NextBorder is non-zero we call DrawBorder
  599.  *  on NextBorder
  600.  */
  601. struct Border
  602. {
  603.     WORD LeftEdge, TopEdge;    /* initial offsets from the origin */
  604.     UBYTE FrontPen, BackPen;    /* pens numbers for rendering */
  605.     UBYTE DrawMode;        /* mode for rendering */
  606.     BYTE Count;            /* number of XY pairs */
  607.     WORD *XY;            /* vector coordinate pairs rel to LeftTop */
  608.     struct Border *NextBorder;    /* pointer to any other Border too */
  609. };
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616. /* ======================================================================== */
  617. /* === Image ============================================================== */
  618. /* ======================================================================== */
  619. /* This is a brief image structure for very simple transfers of
  620.  * image data to a RastPort
  621.  */
  622. struct Image
  623. {
  624.     WORD LeftEdge;        /* starting offset relative to some origin */
  625.     WORD TopEdge;        /* starting offsets relative to some origin */
  626.     WORD Width;            /* pixel size (though data is word-aligned) */
  627.     WORD Height;
  628.     WORD Depth;            /* >= 0, for images you create        */
  629.     UWORD *ImageData;        /* pointer to the actual word-aligned bits */
  630.  
  631.     /* the PlanePick and PlaneOnOff variables work much the same way as the
  632.      * equivalent GELS Bob variables.  It's a space-saving
  633.      * mechanism for image data.  Rather than defining the image data
  634.      * for every plane of the RastPort, you need define data only
  635.      * for the planes that are not entirely zero or one.  As you
  636.      * define your Imagery, you will often find that most of the planes
  637.      * ARE just as color selectors.  For instance, if you're designing
  638.      * a two-color Gadget to use colors one and three, and the Gadget
  639.      * will reside in a five-plane display, bit plane zero of your
  640.      * imagery would be all ones, bit plane one would have data that
  641.      * describes the imagery, and bit planes two through four would be
  642.      * all zeroes.  Using these flags avoids wasting all
  643.      * that memory in this way:  first, you specify which planes you
  644.      * want your data to appear in using the PlanePick variable.  For
  645.      * each bit set in the variable, the next "plane" of your image
  646.      * data is blitted to the display.    For each bit clear in this
  647.      * variable, the corresponding bit in PlaneOnOff is examined.
  648.      * If that bit is clear, a "plane" of zeroes will be used.
  649.      * If the bit is set, ones will go out instead.  So, for our example:
  650.      *     Gadget.PlanePick = 0x02;
  651.      *     Gadget.PlaneOnOff = 0x01;
  652.      * Note that this also allows for generic Gadgets, like the
  653.      * System Gadgets, which will work in any number of bit planes.
  654.      * Note also that if you want an Image that is only a filled
  655.      * rectangle, you can get this by setting PlanePick to zero
  656.      * (pick no planes of data) and set PlaneOnOff to describe the pen
  657.      * color of the rectangle.
  658.      *
  659.      * NOTE:  Intuition relies on PlanePick to know how many planes
  660.      * of data are found in ImageData.    There should be no more
  661.      * '1'-bits in PlanePick than there are planes in ImageData.
  662.      */
  663.     UBYTE PlanePick, PlaneOnOff;
  664.  
  665.     /* if the NextImage variable is not NULL, Intuition presumes that
  666.      * it points to another Image structure with another Image to be
  667.      * rendered
  668.      */
  669.     struct Image *NextImage;
  670. };
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677. /* ======================================================================== */
  678. /* === IntuiMessage ======================================================= */
  679. /* ======================================================================== */
  680. struct IntuiMessage
  681. {
  682.     struct Message ExecMessage;
  683.  
  684.     /* the Class bits correspond directly with the IDCMP Flags, except for the
  685.      * special bit IDCMP_LONELYMESSAGE (defined below)
  686.      */
  687.     ULONG Class;
  688.  
  689.     /* the Code field is for special values like MENU number */
  690.     UWORD Code;
  691.  
  692.     /* the Qualifier field is a copy of the current InputEvent's Qualifier */
  693.     UWORD Qualifier;
  694.  
  695.     /* IAddress contains particular addresses for Intuition functions, like
  696.      * the pointer to the Gadget or the Screen
  697.      */
  698.     APTR IAddress;
  699.  
  700.     /* when getting mouse movement reports, any event you get will have the
  701.      * the mouse coordinates in these variables.  the coordinates are relative
  702.      * to the upper-left corner of your Window (WFLG_GIMMEZEROZERO
  703.      * notwithstanding).  If IDCMP_DELTAMOVE is set, these values will
  704.      * be deltas from the last reported position.
  705.      */
  706.     WORD MouseX, MouseY;
  707.  
  708.     /* the time values are copies of the current system clock time.  Micros
  709.      * are in units of microseconds, Seconds in seconds.
  710.      */
  711.     ULONG Seconds, Micros;
  712.  
  713.     /* the IDCMPWindow variable will always have the address of the Window of
  714.      * this IDCMP
  715.      */
  716.     struct Window *IDCMPWindow;
  717.  
  718.     /* system-use variable */
  719.     struct IntuiMessage *SpecialLink;
  720. };
  721.  
  722.  
  723. /* --- IDCMP Classes ------------------------------------------------------ */
  724. /* Please refer to the Autodoc for OpenWindow() and to the Rom Kernel
  725.  * Manual for full details on the IDCMP classes.
  726.  */
  727. #define IDCMP_SIZEVERIFY    0x00000001
  728. #define IDCMP_NEWSIZE        0x00000002
  729. #define IDCMP_REFRESHWINDOW    0x00000004
  730. #define IDCMP_MOUSEBUTTONS    0x00000008
  731. #define IDCMP_MOUSEMOVE        0x00000010
  732. #define IDCMP_GADGETDOWN    0x00000020
  733. #define IDCMP_GADGETUP        0x00000040
  734. #define IDCMP_REQSET        0x00000080
  735. #define IDCMP_MENUPICK        0x00000100
  736. #define IDCMP_CLOSEWINDOW    0x00000200
  737. #define IDCMP_RAWKEY        0x00000400
  738. #define IDCMP_REQVERIFY        0x00000800
  739. #define IDCMP_REQCLEAR        0x00001000
  740. #define IDCMP_MENUVERIFY    0x00002000
  741. #define IDCMP_NEWPREFS        0x00004000
  742. #define IDCMP_DISKINSERTED    0x00008000
  743. #define IDCMP_DISKREMOVED    0x00010000
  744. #define IDCMP_WBENCHMESSAGE    0x00020000  /*    System use only        */
  745. #define IDCMP_ACTIVEWINDOW    0x00040000
  746. #define IDCMP_INACTIVEWINDOW    0x00080000
  747. #define IDCMP_DELTAMOVE        0x00100000
  748. #define IDCMP_VANILLAKEY    0x00200000
  749. #define IDCMP_INTUITICKS    0x00400000
  750. /*  for notifications from "boopsi" gadgets    */
  751. #define IDCMP_IDCMPUPDATE    0x00800000  /* new for V36    */
  752. /* for getting help key report during menu session    */
  753. #define IDCMP_MENUHELP        0x01000000  /* new for V36    */
  754. /* for notification of any move/size/zoom/change window        */
  755. #define IDCMP_CHANGEWINDOW    0x02000000  /* new for V36    */
  756.  
  757. /* NOTEZ-BIEN:                0x80000000 is reserved for internal use   */
  758.  
  759. /* the IDCMP Flags do not use this special bit, which is cleared when
  760.  * Intuition sends its special message to the Task, and set when Intuition
  761.  * gets its Message back from the Task.  Therefore, I can check here to
  762.  * find out fast whether or not this Message is available for me to send
  763.  */
  764. #define IDCMP_LONELYMESSAGE    0x80000000
  765.  
  766.  
  767. /* --- IDCMP Codes -------------------------------------------------------- */
  768. /* This group of codes is for the IDCMP_MENUVERIFY function */
  769. #define MENUHOT        0x0001    /* IntuiWants verification or MENUCANCEL    */
  770. #define MENUCANCEL    0x0002    /* HOT Reply of this cancels Menu operation */
  771. #define MENUWAITING    0x0003    /* Intuition simply wants a ReplyMsg() ASAP */
  772.  
  773. /* These are internal tokens to represent state of verification attempts
  774.  * shown here as a clue.
  775.  */
  776. #define OKOK        MENUHOT    /* guy didn't care            */
  777. #define OKABORT        0x0004    /* window rendered question moot    */
  778. #define OKCANCEL    MENUCANCEL /* window sent cancel reply        */
  779.  
  780. /* This group of codes is for the IDCMP_WBENCHMESSAGE messages */
  781. #define WBENCHOPEN    0x0001
  782. #define WBENCHCLOSE    0x0002
  783.  
  784.  
  785. /* A data structure common in V36 Intuition processing    */
  786. struct IBox {
  787.     WORD Left;
  788.     WORD Top;
  789.     WORD Width;
  790.     WORD Height;
  791.     };
  792.  
  793.  
  794.  
  795. /* ======================================================================== */
  796. /* === Window ============================================================= */
  797. /* ======================================================================== */
  798. struct Window
  799. {
  800.     struct Window *NextWindow;        /* for the linked list in a screen */
  801.  
  802.     WORD LeftEdge, TopEdge;        /* screen dimensions of window */
  803.     WORD Width, Height;            /* screen dimensions of window */
  804.  
  805.     WORD MouseY, MouseX;        /* relative to upper-left of window */
  806.  
  807.     WORD MinWidth, MinHeight;        /* minimum sizes */
  808.     UWORD MaxWidth, MaxHeight;        /* maximum sizes */
  809.  
  810.     ULONG Flags;            /* see below for defines */
  811.  
  812.     struct Menu *MenuStrip;        /* the strip of Menu headers */
  813.  
  814.     UBYTE *Title;            /* the title text for this window */
  815.  
  816.     struct Requester *FirstRequest;    /* all active Requesters */
  817.  
  818.     struct Requester *DMRequest;    /* double-click Requester */
  819.  
  820.     WORD ReqCount;            /* count of reqs blocking Window */
  821.  
  822.     struct Screen *WScreen;        /* this Window's Screen */
  823.     struct RastPort *RPort;        /* this Window's very own RastPort */
  824.  
  825.     /* the border variables describe the window border.  If you specify
  826.      * WFLG_GIMMEZEROZERO when you open the window, then the upper-left of
  827.      * the ClipRect for this window will be upper-left of the BitMap (with
  828.      * correct offsets when in SuperBitMap mode; you MUST select
  829.      * WFLG_GIMMEZEROZERO when using SuperBitMap).  If you don't specify
  830.      * ZeroZero, then you save memory (no allocation of RastPort, Layer,
  831.      * ClipRect and associated Bitmaps), but you also must offset all your
  832.      * writes by BorderTop, BorderLeft and do your own mini-clipping to
  833.      * prevent writing over the system gadgets
  834.      */
  835.     BYTE BorderLeft, BorderTop, BorderRight, BorderBottom;
  836.     struct RastPort *BorderRPort;
  837.  
  838.  
  839.     /* You supply a linked-list of Gadgets for your Window.
  840.      * This list DOES NOT include system gadgets.  You get the standard
  841.      * window system gadgets by setting flag-bits in the variable Flags (see
  842.      * the bit definitions below)
  843.      */
  844.     struct Gadget *FirstGadget;
  845.  
  846.     /* these are for opening/closing the windows */
  847.     struct Window *Parent, *Descendant;
  848.  
  849.     /* sprite data information for your own Pointer
  850.      * set these AFTER you Open the Window by calling SetPointer()
  851.      */
  852.     UWORD *Pointer;    /* sprite data */
  853.     BYTE PtrHeight;    /* sprite height (not including sprite padding) */
  854.     BYTE PtrWidth;    /* sprite width (must be less than or equal to 16) */
  855.     BYTE XOffset, YOffset;    /* sprite offsets */
  856.  
  857.     /* the IDCMP Flags and User's and Intuition's Message Ports */
  858.     ULONG IDCMPFlags;    /* User-selected flags */
  859.     struct MsgPort *UserPort, *WindowPort;
  860.     struct IntuiMessage *MessageKey;
  861.  
  862.     UBYTE DetailPen, BlockPen;    /* for bar/border/gadget rendering */
  863.  
  864.     /* the CheckMark is a pointer to the imagery that will be used when
  865.      * rendering MenuItems of this Window that want to be checkmarked
  866.      * if this is equal to NULL, you'll get the default imagery
  867.      */
  868.     struct Image *CheckMark;
  869.  
  870.     UBYTE *ScreenTitle;    /* if non-null, Screen title when Window is active */
  871.  
  872.     /* These variables have the mouse coordinates relative to the
  873.      * inner-Window of WFLG_GIMMEZEROZERO Windows.  This is compared with the
  874.      * MouseX and MouseY variables, which contain the mouse coordinates
  875.      * relative to the upper-left corner of the Window, WFLG_GIMMEZEROZERO
  876.      * notwithstanding
  877.      */
  878.     WORD GZZMouseX;
  879.     WORD GZZMouseY;
  880.     /* these variables contain the width and height of the inner-Window of
  881.      * WFLG_GIMMEZEROZERO Windows
  882.      */
  883.     WORD GZZWidth;
  884.     WORD GZZHeight;
  885.  
  886.     UBYTE *ExtData;
  887.  
  888.     BYTE *UserData;    /* general-purpose pointer to User data extension */
  889.  
  890.     /** 11/18/85: this pointer keeps a duplicate of what
  891.      * Window.RPort->Layer is _supposed_ to be pointing at
  892.      */
  893.     struct Layer *WLayer;
  894.  
  895.     /* NEW 1.2: need to keep track of the font that
  896.      * OpenWindow opened, in case user SetFont's into RastPort
  897.      */
  898.     struct TextFont *IFont;
  899.  
  900.     /* (V36) another flag word (the Flags field is used up).
  901.      * At present, all flag values are system private.
  902.      * Until further notice, you may not change nor use this field.
  903.      */
  904.     ULONG    MoreFlags;
  905.  
  906.     /**** Data beyond this point are Intuition Private.  DO NOT USE ****/
  907. };
  908.  
  909.  
  910. /* --- Flags requested at OpenWindow() time by the application --------- */
  911. #define WFLG_SIZEGADGET        0x00000001    /* include sizing system-gadget? */
  912. #define WFLG_DRAGBAR        0x00000002    /* include dragging system-gadget? */
  913. #define WFLG_DEPTHGADGET    0x00000004    /* include depth arrangement gadget? */
  914. #define WFLG_CLOSEGADGET    0x00000008    /* include close-box system-gadget? */
  915.  
  916. #define WFLG_SIZEBRIGHT        0x00000010    /* size gadget uses right border */
  917. #define WFLG_SIZEBBOTTOM    0x00000020    /* size gadget uses bottom border */
  918.  
  919. /* --- refresh modes ------------------------------------------------------ */
  920. /* combinations of the WFLG_REFRESHBITS select the refresh type */
  921. #define WFLG_REFRESHBITS    0x000000C0
  922. #define WFLG_SMART_REFRESH  0x00000000
  923. #define WFLG_SIMPLE_REFRESH 0x00000040
  924. #define WFLG_SUPER_BITMAP   0x00000080
  925. #define WFLG_OTHER_REFRESH  0x000000C0
  926.  
  927. #define WFLG_BACKDROP        0x00000100    /* this is a backdrop window */
  928.  
  929. #define WFLG_REPORTMOUSE    0x00000200    /* to hear about every mouse move */
  930.  
  931. #define WFLG_GIMMEZEROZERO  0x00000400    /* a GimmeZeroZero window    */
  932.  
  933. #define WFLG_BORDERLESS        0x00000800    /* to get a Window sans border */
  934.  
  935. #define WFLG_ACTIVATE        0x00001000    /* when Window opens, it's Active */
  936.  
  937.  
  938. /* FLAGS SET BY INTUITION */
  939. #define WFLG_WINDOWACTIVE   0x00002000    /* this window is the active one */
  940. #define WFLG_INREQUEST        0x00004000    /* this window is in request mode */
  941. #define WFLG_MENUSTATE        0x00008000    /* Window is active with Menus on */
  942.  
  943. /* --- Other User Flags --------------------------------------------------- */
  944. #define WFLG_RMBTRAP        0x00010000    /* Catch RMB events for your own */
  945. #define WFLG_NOCAREREFRESH  0x00020000    /* not to be bothered with REFRESH */
  946.  
  947. /* --- Other Intuition Flags ---------------------------------------------- */
  948. #define WFLG_WINDOWREFRESH  0x01000000    /* Window is currently refreshing */
  949. #define WFLG_WBENCHWINDOW   0x02000000    /* WorkBench tool ONLY Window */
  950. #define WFLG_WINDOWTICKED   0x04000000    /* only one timer tick at a time */
  951.  
  952.  
  953. /* - V36 new Flags which the programmer may specify in NewWindow.Flags    */
  954. #define WFLG_NW_EXTENDED    0x00040000    /* extension data provided    */
  955.                     /* see struct ExtNewWindow    */
  956.  
  957. /* --- V36 Flags to be set only by Intuition -------------------------    */
  958. #define WFLG_VISITOR        0x08000000    /* visitor window        */
  959. #define WFLG_ZOOMED        0x10000000    /* identifies "zoom state"    */
  960. #define WFLG_HASZOOM        0x20000000    /* windowhas a zoom gadget    */
  961.  
  962. /* --- Other Window Values ---------------------------------------------- */
  963. #define DEFAULTMOUSEQUEUE    (5)    /* no more mouse messages    */
  964.  
  965. /* --- see struct IntuiMessage for the IDCMP Flag definitions ------------- */
  966.  
  967.  
  968.  
  969.  
  970. /* ======================================================================== */
  971. /* === NewWindow ========================================================== */
  972. /* ======================================================================== */
  973. /*
  974.  * Note that the new extension fields have been removed.  Use ExtNewWindow
  975.  * structure below to make use of these fields
  976.  */
  977. struct NewWindow
  978. {
  979.     WORD LeftEdge, TopEdge;        /* screen dimensions of window */
  980.     WORD Width, Height;            /* screen dimensions of window */
  981.  
  982.     UBYTE DetailPen, BlockPen;        /* for bar/border/gadget rendering */
  983.  
  984.     ULONG IDCMPFlags;            /* User-selected IDCMP flags */
  985.  
  986.     ULONG Flags;            /* see Window struct for defines */
  987.  
  988.     /* You supply a linked-list of Gadgets for your Window.
  989.      *    This list DOES NOT include system Gadgets.  You get the standard
  990.      *    system Window Gadgets by setting flag-bits in the variable Flags (see
  991.      *    the bit definitions under the Window structure definition)
  992.      */
  993.     struct Gadget *FirstGadget;
  994.  
  995.     /* the CheckMark is a pointer to the imagery that will be used when
  996.      * rendering MenuItems of this Window that want to be checkmarked
  997.      * if this is equal to NULL, you'll get the default imagery
  998.      */
  999.     struct Image *CheckMark;
  1000.  
  1001.     UBYTE *Title;              /* the title text for this window */
  1002.  
  1003.     /* the Screen pointer is used only if you've defined a CUSTOMSCREEN and
  1004.      * want this Window to open in it.    If so, you pass the address of the
  1005.      * Custom Screen structure in this variable.  Otherwise, this variable
  1006.      * is ignored and doesn't have to be initialized.
  1007.      */
  1008.     struct Screen *Screen;
  1009.  
  1010.     /* WFLG_SUPER_BITMAP Window?  If so, put the address of your BitMap
  1011.      * structure in this variable.  If not, this variable is ignored and
  1012.      * doesn't have to be initialized
  1013.      */
  1014.     struct BitMap *BitMap;
  1015.  
  1016.     /* the values describe the minimum and maximum sizes of your Windows.
  1017.      * these matter only if you've chosen the WFLG_SIZEGADGET option,
  1018.      * which means that you want to let the User to change the size of
  1019.      * this Window.  You describe the minimum and maximum sizes that the
  1020.      * Window can grow by setting these variables.  You can initialize
  1021.      * any one these to zero, which will mean that you want to duplicate
  1022.      * the setting for that dimension (if MinWidth == 0, MinWidth will be
  1023.      * set to the opening Width of the Window).
  1024.      * You can change these settings later using SetWindowLimits().
  1025.      * If you haven't asked for a SIZING Gadget, you don't have to
  1026.      * initialize any of these variables.
  1027.      */
  1028.     WORD MinWidth, MinHeight;        /* minimums */
  1029.     UWORD MaxWidth, MaxHeight;         /* maximums */
  1030.  
  1031.     /* the type variable describes the Screen in which you want this Window to
  1032.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1033.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1034.      * type definitions under the Screen structure.
  1035.      */
  1036.     UWORD Type;
  1037.  
  1038. };
  1039.  
  1040. /* The following structure is the future NewWindow.  Compatibility
  1041.  * issues require that the size of NewWindow not change.
  1042.  * Data in the common part (NewWindow) indicates the the extension
  1043.  * fields are being used.
  1044.  * NOTE WELL: This structure may be subject to future extension.
  1045.  * Writing code depending on its size is not allowed.
  1046.  */
  1047. struct ExtNewWindow
  1048. {
  1049.     WORD LeftEdge, TopEdge;
  1050.     WORD Width, Height;
  1051.  
  1052.     UBYTE DetailPen, BlockPen;
  1053.     ULONG IDCMPFlags;
  1054.     ULONG Flags;
  1055.     struct Gadget *FirstGadget;
  1056.  
  1057.     struct Image *CheckMark;
  1058.  
  1059.     UBYTE *Title;
  1060.     struct Screen *Screen;
  1061.     struct BitMap *BitMap;
  1062.  
  1063.     WORD MinWidth, MinHeight;
  1064.     UWORD MaxWidth, MaxHeight;
  1065.  
  1066.     /* the type variable describes the Screen in which you want this Window to
  1067.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1068.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1069.      * type definitions under the Screen structure.
  1070.      * A new possible value for this field is PUBLICSCREEN, which
  1071.      * defines the window as a 'visitor' window.  See below for
  1072.      * additional information provided.
  1073.      */
  1074.     UWORD Type;
  1075.  
  1076.     /* ------------------------------------------------------- *
  1077.      * extensions for V36
  1078.      * if the NewWindow Flag value WFLG_NW_EXTENDED is set, then
  1079.      * this field is assumed to point to an array ( or chain of arrays)
  1080.      * of TagItem structures.  See also ExtNewScreen for another
  1081.      * use of TagItems to pass optional data.
  1082.      *
  1083.      * see below for tag values and the corresponding data.
  1084.      */
  1085.     struct TagItem    *Extension;
  1086. };
  1087.  
  1088. /*
  1089.  * The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow.
  1090.  * They are values in a TagItem array passed as extension/replacement
  1091.  * values for the data in NewWindow.  OpenWindowTagList() can actually
  1092.  * work well with a NULL NewWindow pointer.
  1093.  */
  1094.  
  1095. #define WA_Dummy    (TAG_USER + 99)    /* 0x80000063    */
  1096.  
  1097. /* these tags simply override NewWindow parameters */
  1098. #define WA_Left            (WA_Dummy + 0x01)
  1099. #define WA_Top            (WA_Dummy + 0x02)
  1100. #define WA_Width        (WA_Dummy + 0x03)
  1101. #define WA_Height        (WA_Dummy + 0x04)
  1102. #define WA_DetailPen        (WA_Dummy + 0x05)
  1103. #define WA_BlockPen        (WA_Dummy + 0x06)
  1104. #define WA_IDCMP        (WA_Dummy + 0x07)
  1105.             /* "bulk" initialization of NewWindow.Flags */
  1106. #define WA_Flags        (WA_Dummy + 0x08)
  1107. #define WA_Gadgets        (WA_Dummy + 0x09)
  1108. #define WA_Checkmark        (WA_Dummy + 0x0A)
  1109. #define WA_Title        (WA_Dummy + 0x0B)
  1110.             /* means you don't have to call SetWindowTitles
  1111.              * after you open your window
  1112.              */
  1113. #define WA_ScreenTitle        (WA_Dummy + 0x0C)
  1114. #define WA_CustomScreen        (WA_Dummy + 0x0D)
  1115. #define WA_SuperBitMap        (WA_Dummy + 0x0E)
  1116.             /* also implies WFLG_SUPER_BITMAP property    */
  1117. #define WA_MinWidth        (WA_Dummy + 0x0F)
  1118. #define WA_MinHeight        (WA_Dummy + 0x10)
  1119. #define WA_MaxWidth        (WA_Dummy + 0x11)
  1120. #define WA_MaxHeight        (WA_Dummy + 0x12)
  1121.  
  1122. /* The following are specifications for new features    */
  1123.  
  1124. #define WA_InnerWidth        (WA_Dummy + 0x13)
  1125. #define WA_InnerHeight        (WA_Dummy + 0x14)
  1126.             /* You can specify the dimensions of the interior
  1127.              * region of your window, independent of what
  1128.              * the border widths will be.  You probably want
  1129.              * to also specify WA_AutoAdjust to allow
  1130.              * Intuition to move your window or even
  1131.              * shrink it so that it is completely on screen.
  1132.              */
  1133.  
  1134. #define WA_PubScreenName    (WA_Dummy + 0x15)
  1135.             /* declares that you want the window to open as
  1136.              * a visitor on the public screen whose name is
  1137.              * pointed to by (UBYTE *) ti_Data
  1138.              */
  1139. #define WA_PubScreen        (WA_Dummy + 0x16)
  1140.             /* open as a visitor window on the public screen
  1141.              * whose address is in (struct Screen *) ti_Data.
  1142.              * To ensure that this screen remains open, you
  1143.              * should either be the screen's owner, have a
  1144.              * window open on the screen, or use LockPubScreen().
  1145.              */
  1146. #define WA_PubScreenFallBack    (WA_Dummy + 0x17)
  1147.             /* A Boolean, specifies whether a visitor window
  1148.              * should "fall back" to the default public screen
  1149.              * (or Workbench) if the named public screen isn't
  1150.              * available
  1151.              */
  1152. #define WA_WindowName        (WA_Dummy + 0x18)
  1153.             /* not implemented    */
  1154. #define WA_Colors        (WA_Dummy + 0x19)
  1155.             /* a ColorSpec array for colors to be set
  1156.              * when this window is active.    This is not
  1157.              * implemented, and may not be, since the default
  1158.              * values to restore would be hard to track.
  1159.              * We'd like to at least support per-window colors
  1160.              * for the mouse pointer sprite.
  1161.              */
  1162. #define WA_Zoom        (WA_Dummy + 0x1A)
  1163.             /* ti_Data points to an array of four WORD's,
  1164.              * the initial Left/Top/Width/Height values of
  1165.              * the "alternate" zoom position/dimensions.
  1166.              * It also specifies that you want a Zoom gadget
  1167.              * for your window, whether or not you have a
  1168.              * sizing gadget.
  1169.              */
  1170. #define WA_MouseQueue        (WA_Dummy + 0x1B)
  1171.             /* ti_Data contains initial value for the mouse
  1172.              * message backlog limit for this window.
  1173.              */
  1174. #define WA_BackFill        (WA_Dummy + 0x1C)
  1175.             /* unimplemented at present: provides a "backfill
  1176.              * hook" for your window's layer.
  1177.              */
  1178. #define WA_RptQueue        (WA_Dummy + 0x1D)
  1179.             /* initial value of repeat key backlog limit    */
  1180.  
  1181.     /* These Boolean tag items are alternatives to the NewWindow.Flags
  1182.      * boolean flags with similar names.
  1183.      */
  1184. #define WA_SizeGadget        (WA_Dummy + 0x1E)
  1185. #define WA_DragBar        (WA_Dummy + 0x1F)
  1186. #define WA_DepthGadget        (WA_Dummy + 0x20)
  1187. #define WA_CloseGadget        (WA_Dummy + 0x21)
  1188. #define WA_Backdrop        (WA_Dummy + 0x22)
  1189. #define WA_ReportMouse        (WA_Dummy + 0x23)
  1190. #define WA_NoCareRefresh    (WA_Dummy + 0x24)
  1191. #define WA_Borderless        (WA_Dummy + 0x25)
  1192. #define WA_Activate        (WA_Dummy + 0x26)
  1193. #define WA_RMBTrap        (WA_Dummy + 0x27)
  1194. #define WA_WBenchWindow        (WA_Dummy + 0x28)    /* PRIVATE!! */
  1195. #define WA_SimpleRefresh    (WA_Dummy + 0x29)
  1196.             /* only specify if TRUE    */
  1197. #define WA_SmartRefresh        (WA_Dummy + 0x2A)
  1198.             /* only specify if TRUE    */
  1199. #define WA_SizeBRight        (WA_Dummy + 0x2B)
  1200. #define WA_SizeBBottom        (WA_Dummy + 0x2C)
  1201.  
  1202.     /* New Boolean properties    */
  1203. #define WA_AutoAdjust        (WA_Dummy + 0x2D)
  1204.             /* shift or squeeze the window's position and
  1205.              * dimensions to fit it on screen.
  1206.              */
  1207.  
  1208. #define WA_GimmeZeroZero    (WA_Dummy + 0x2E)
  1209.             /* equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO    */
  1210.  
  1211. /* New for V37: WA_MenuHelp (ignored by V36) */
  1212. #define WA_MenuHelp        (WA_Dummy + 0x2F)
  1213.             /* Enables IDCMP_MENUHELP:  Pressing HELP during menus
  1214.              * will return IDCMP_MENUHELP message.
  1215.              */
  1216.  
  1217.  
  1218.  
  1219. #ifndef INTUITION_SCREENS_H
  1220. #include <intuition/screens.h>
  1221. #endif
  1222.  
  1223. #ifndef INTUITION_PREFERENCES_H
  1224. #include <intuition/preferences.h>
  1225. #endif
  1226.  
  1227. /* ======================================================================== */
  1228. /* === Remember =========================================================== */
  1229. /* ======================================================================== */
  1230. /* this structure is used for remembering what memory has been allocated to
  1231.  * date by a given routine, so that a premature abort or systematic exit
  1232.  * can deallocate memory cleanly, easily, and completely
  1233.  */
  1234. struct Remember
  1235. {
  1236.     struct Remember *NextRemember;
  1237.     ULONG RememberSize;
  1238.     UBYTE *Memory;
  1239. };
  1240.  
  1241.  
  1242. /* === Color Spec ====================================================== */
  1243. /* How to tell Intuition about RGB values for a color table entry. */
  1244. struct ColorSpec {
  1245.     WORD    ColorIndex;    /* -1 terminates an array of ColorSpec    */
  1246.     UWORD    Red;        /* only 6 bits recognized in V36    */
  1247.     UWORD    Green;        /* only 6 bits recognized in V36    */
  1248.     UWORD    Blue;        /* only 6 bits recognized in V36    */
  1249. };
  1250.  
  1251. /* === Easy Requester Specification ======================================= */
  1252. /* see also autodocs for EasyRequest and BuildEasyRequest    */
  1253. /* NOTE: This structure may grow in size in the future        */
  1254. struct EasyStruct {
  1255.     ULONG    es_StructSize;    /* should be sizeof (struct EasyStruct )*/
  1256.     ULONG    es_Flags;    /* should be 0 for now            */
  1257.     UBYTE    *es_Title;    /* title of requester window        */
  1258.     UBYTE    *es_TextFormat;    /* 'printf' style formatting string    */
  1259.     UBYTE    *es_GadgetFormat; /* 'printf' style formatting string    */
  1260. };
  1261.  
  1262.  
  1263.  
  1264. /* ======================================================================== */
  1265. /* === Miscellaneous ====================================================== */
  1266. /* ======================================================================== */
  1267.  
  1268. /* = MACROS ============================================================== */
  1269. #define MENUNUM(n) (n & 0x1F)
  1270. #define ITEMNUM(n) ((n >> 5) & 0x003F)
  1271. #define SUBNUM(n) ((n >> 11) & 0x001F)
  1272.  
  1273. #define SHIFTMENU(n) (n & 0x1F)
  1274. #define SHIFTITEM(n) ((n & 0x3F) << 5)
  1275. #define SHIFTSUB(n) ((n & 0x1F) << 11)
  1276.  
  1277. #define FULLMENUNUM( menu, item, sub )    \
  1278.     ( SHIFTSUB(sub) | SHIFTITEM(item) | SHIFTMENU(menu) )
  1279.  
  1280. #define SRBNUM(n)    (0x08 - (n >> 4))    /* SerRWBits -> read bits per char */
  1281. #define SWBNUM(n)    (0x08 - (n & 0x0F))/* SerRWBits -> write bits per chr */
  1282. #define SSBNUM(n)    (0x01 + (n >> 4))    /* SerStopBuf -> stop bits per chr */
  1283. #define SPARNUM(n)   (n >> 4)        /* SerParShk -> parity setting      */
  1284. #define SHAKNUM(n)   (n & 0x0F)    /* SerParShk -> handshake mode      */
  1285.  
  1286.  
  1287. /* = MENU STUFF =========================================================== */
  1288. #define NOMENU 0x001F
  1289. #define NOITEM 0x003F
  1290. #define NOSUB  0x001F
  1291. #define MENUNULL 0xFFFF
  1292.  
  1293.  
  1294. /* = =RJ='s peculiarities ================================================= */
  1295. #define FOREVER for(;;)
  1296. #define SIGN(x) ( ((x) > 0) - ((x) < 0) )
  1297. #define NOT !
  1298.  
  1299. /* these defines are for the COMMSEQ and CHECKIT menu stuff.  If CHECKIT,
  1300.  * I'll use a generic Width (for all resolutions) for the CheckMark.
  1301.  * If COMMSEQ, likewise I'll use this generic stuff
  1302.  */
  1303. #define CHECKWIDTH    19
  1304. #define COMMWIDTH    27
  1305. #define LOWCHECKWIDTH    13
  1306. #define LOWCOMMWIDTH    16
  1307.  
  1308.  
  1309. /* these are the AlertNumber defines.  if you are calling DisplayAlert()
  1310.  * the AlertNumber you supply must have the ALERT_TYPE bits set to one
  1311.  * of these patterns
  1312.  */
  1313. #define ALERT_TYPE    0x80000000
  1314. #define RECOVERY_ALERT    0x00000000    /* the system can recover from this */
  1315. #define DEADEND_ALERT    0x80000000    /* no recovery possible, this is it */
  1316.  
  1317.  
  1318. /* When you're defining IntuiText for the Positive and Negative Gadgets
  1319.  * created by a call to AutoRequest(), these defines will get you
  1320.  * reasonable-looking text.  The only field without a define is the IText
  1321.  * field; you decide what text goes with the Gadget
  1322.  */
  1323. #define AUTOFRONTPEN    0
  1324. #define AUTOBACKPEN    1
  1325. #define AUTODRAWMODE    JAM2
  1326. #define AUTOLEFTEDGE    6
  1327. #define AUTOTOPEDGE    3
  1328. #define AUTOITEXTFONT    NULL
  1329. #define AUTONEXTTEXT    NULL
  1330.  
  1331.  
  1332. /* --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) ------------------- */
  1333. #define SELECTUP    (IECODE_LBUTTON | IECODE_UP_PREFIX)
  1334. #define SELECTDOWN    (IECODE_LBUTTON)
  1335. #define MENUUP        (IECODE_RBUTTON | IECODE_UP_PREFIX)
  1336. #define MENUDOWN    (IECODE_RBUTTON)
  1337. #define MIDDLEDOWN    (IECODE_MBUTTON)
  1338. #define MIDDLEUP    (IECODE_MBUTTON | IECODE_UP_PREFIX)
  1339. #define ALTLEFT        (IEQUALIFIER_LALT)
  1340. #define ALTRIGHT    (IEQUALIFIER_RALT)
  1341. #define AMIGALEFT    (IEQUALIFIER_LCOMMAND)
  1342. #define AMIGARIGHT    (IEQUALIFIER_RCOMMAND)
  1343. #define AMIGAKEYS    (AMIGALEFT | AMIGARIGHT)
  1344.  
  1345. #define CURSORUP    0x4C
  1346. #define CURSORLEFT    0x4F
  1347. #define CURSORRIGHT    0x4E
  1348. #define CURSORDOWN    0x4D
  1349. #define KEYCODE_Q    0x10
  1350. #define KEYCODE_Z    0x31
  1351. #define KEYCODE_X    0x32
  1352. #define KEYCODE_V    0x34
  1353. #define KEYCODE_B    0x35
  1354. #define KEYCODE_N    0x36
  1355. #define KEYCODE_M    0x37
  1356. #define KEYCODE_LESS    0x38
  1357. #define KEYCODE_GREATER 0x39
  1358.  
  1359. /* Include obsolete identifiers: */
  1360. #ifndef INTUITION_IOBSOLETE_H
  1361. #include <intuition/iobsolete.h>
  1362. #endif
  1363.  
  1364. #endif
  1365.